from django.contrib import admin
from .models import Post, Comment
# Register your models here.
admin.site.register(Post)
@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
 # 配置在管理后台可以查看到的字段
 list_display = ('name', 'email', 'post', 'created', 'active')
 # 配置在管理后台可以进行过滤的字段
 list_filter = ('active', 'created', 'updated')
 # 配置在管理后台可以进行搜索的字段
 search_fields = ('name', 'email', 'body')